package cn.com.yusys.yusp.admin.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfiguration {
    @Value("${sso.checkTokenUrl}")
    private String checkTokenUrl;

    @Bean
    public FilterRegistrationBean testFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new com.wjrcb.ssoms.filter.SSOLoginFilter());
        registration.addUrlPatterns("/*");
        registration.addInitParameter("checkTokenUrl", checkTokenUrl);
        registration.setName("SSOLoginFilter");
        registration.setOrder(1);
        return registration;
    }
}